
using System;
using System.Data;
using System.Web.Caching;
using System.Reflection;
using DotNetNuke;
using DotNetNuke.Common;
using DotNetNuke.Common.Utilities;
using DotNetNuke.Services.Localization;

namespace BiteTheBullet.DNN.Modules.BTBYahooWeather.Data
{
	public abstract class DataProvider
	{
        // singleton reference to the instantiated object 
		private static DataProvider objProvider = null;

		// constructor
		static DataProvider()
		{
			CreateProvider();
		}

		// dynamically create provider
		private static void CreateProvider()
		{
			objProvider = ((DataProvider)DotNetNuke.Framework.Reflection.CreateObject("data", "BiteTheBullet.DNN.Modules.BTBYahooWeather.Data", "BiteTheBullet.DNN.Modules.BTBYahooWeather"));
		}

		// return the provider
		public static DataProvider Instance()
		{
			return objProvider;
		}
		public abstract IDataReader GetBTBWeatherFeed(int weatherId);
		public abstract IDataReader GetBTBWeatherFeedByModule(int moduleId);
		public abstract int AddBTBWeatherFeed(int moduleId , int ttl , DateTime updatedDate , 
												DateTime cachedDate , string feed , string url, 
												string transformedFeed, string locationName);
		public abstract void UpdateBTBWeatherFeed(int weatherId, int moduleId , int ttl ,
													DateTime updatedDate , DateTime cachedDate , string feed , 
													string url, string transformedFeed, string locationName);
		public abstract void DeleteBTBWeatherFeed(int weatherId);
		public abstract void SetDefaultFeed(int moduleId, int weatherId);
		#endregion
	}
}
